<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib tagdir="/WEB-INF/tags/sys"  prefix="sys"%>
<%@ taglib uri="/WEB-INF/tlds/webui.tld"  prefix="webui"%>

<webui:enum var="operateTypeEnum" code="OperateType" />
<webui:enum var="objectTypeEnum" code="ObjectType" />
<webui:enum var="orgEnum" code="OrgEnum" appendJs="true"/>
<webui:enum var="operatorEnum" code="operatorEnum" />
<script>
	function deleteRecord(table,data){
		var logs = data.data;
		$(logs).each(function(index,element){
			var _self = this;
			var orgName = orgEnum[element.cpContent.orgId];
			Vue.set(_self,"orgName",orgName);
		});
		var contentCount = data.page.totalElements;
		if(!document.getElementById("table_length")){
			$("#tb_delete_logs_paginate").parent().prev().append("<div id='table_length' style='float:left'></div>");
		}
		if (contentCount > 0) {
			$("#table_length").html("共"+contentCount+"条数据");
		} else {
			$("#table_length").html("");
		}
	}
</script>
<webui:panel title="已删除内容">
	<webui:form id="deleteHistorySearchForm" styleClass="form-horizontal" action="${contextPath}/declare/cpContent/cpContentAndOplog.action?operateType=delete"
				method="get" name="deleteHistorySearchForm">
		<webui:input label="片名" name="name" styleClass="col-sm-4" labelClass="col-sm-4" inputClass="col-sm-8"
					type="text"></webui:input>
		<webui:select label="CP名称" name="orgName" styleClass="col-sm-4" labelClass="col-sm-4" inputClass="col-sm-8"
					lookup="${orgEnum}"></webui:select>
		<webui:select label="操作员" name="opName" styleClass="col-sm-4" labelClass="col-sm-4" inputClass="col-sm-8"
					lookup="${operatorEnum}"></webui:select>
		<div class="col-sm-12"></div>
		<webui:datepicker beginId="beginTimeSearch" beginName="beginTime" label="修改时间" styleClass="col-sm-5" labelClass="col-sm-3" inputClass="col-sm-9"
							 endName="endTime" endId="endTimeSearch" level="date" duration="true">
		</webui:datepicker>
		<webui:button type="button" styleClass="col-sm-6" inputClass="col-sm-1" buttonClass="btn-primary" label="" labelClass="col-sm-4"
						onclick="tb_delete_logs.filter()">查询
		</webui:button>
	</webui:form>
	<webui:table id="tb_delete_logs" datas="data" dataUrl="${contextPath}/declare/cpContent/cpContentAndOplog.action?operateType=delete"
				 dataload="deleteRecord" searchForm="#deleteHistorySearch">
		<webui:column field="name" title="片名">{{row.cpContent.name}}</webui:column>
		<webui:column field="orgName" title="CP名称">{{row.orgName}}</webui:column>
		<webui:column field="operateTime" title="删除时间">{{row.oplog.operateTime| moment('YYYY-MM-DD HH:mm:ss')}}</webui:column>
		<webui:column field="opName" title="操作员">{{row.oplog.opName}}</webui:column>
	</webui:table>
</webui:panel>